package com.lgy.controller;

import com.lgy.mapper.UserMapper;
import com.lgy.model.entity.User;
import com.lgy.service.IDeploymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MyTestController {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private IDeploymentService deploymentService;
    /**
     * 测试crul：http://localhost:8088/test
     * @return
     */
    @GetMapping("/test")
    public String test() {
        System.out.println(userMapper + "------------>" + deploymentService);
        System.out.println(("----- selectAll method test ------"));
        List<User> userList = userMapper.selectList(null);
        Assert.isTrue(5 == userList.size(), "");
        userList.forEach(System.out::println);
        return "success";
    }
}
